package org.ssh.dao.impl;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import org.ssh.pojo.User;
import org.ssh.pojo.Dept;

import org.ssh.dao.IUserDao;


public class UserDao extends BaseDao implements IUserDao{

	public int edituserdept(User user, Dept dept) {
		// TODO Auto-generated method stub
		try {
			getHibernateTemplate().saveOrUpdate(user);
			getHibernateTemplate().saveOrUpdate(dept);
			return 1;
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		return 0;
	}

}